package com.fowo.api.sys.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fowo.api.common.annotaion.TitleField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;

/**
 * 职位
 */
@EqualsAndHashCode(callSuper = true)
@Schema(title = "职位")
@TableName("sys_posts")
@Data
public class SysPost extends SysBase {

    @Schema(title = "名称")
    @TitleField
    @NotEmpty(message = "名称不能为空")
    @Length(max = 20, message = "名称最长 20 个字符")
    private String name;

    @Schema(title = "代码")
    @NotEmpty(message = "代码不能为空")
    @Length(max = 50, message = "代码最长 50 个字符")
    private String code;

    @Length(max = 20, message = "颜色最长 20 个字符")
    @Schema(title = "颜色")
    private String color;

    @Schema(title = "说明")
    @Length(max = 2000, message = "说明最长 2000 个字符")
    private String description;
}
